package me.sdevil507.biz.common.oss;

import lombok.extern.slf4j.Slf4j;
import me.sdevil507.clouddisk.helper.CloudDiskHelper;
import me.sdevil507.supports.result.ApiResultDTO;
import me.sdevil507.supports.result.ApiResultGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/common/oss")
public class OssController {

    @Autowired
    private CloudDiskHelper cloudDiskHelper;

    /**
     * 获取oss ststoken
     */
    @PostMapping("/getStsToken")
    public ApiResultDTO getStsToken() {
        return ApiResultGenerator.create("0", "获取token成功!", cloudDiskHelper.getStsToken());
    }

}